package ch0001;

import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

public class MyFrame extends JFrame {

	JLabel labelname;
	JTextField textname;
	JLabel labelpassword;
	JPasswordField password1;
	JButton button1;
	JLabel labelpicture;
	JLabel labelage;
	JTextField textage;
	JLabel labelhigh;
	JTextField texthigh;

	public MyFrame() {
		setTitle("sias");
		setSize(500, 300);

		ImageIcon icon = new ImageIcon("image\\koala.jpg");
		Image image1 = icon.getImage();
		setIconImage(image1);

		labelname = new JLabel("name");
		textname = new JTextField(10);
		labelpassword = new JLabel("password");
		password1 = new JPasswordField(10);
		button1 = new JButton("È·¶¨");
		labelpicture = new JLabel(icon);
		labelage = new JLabel("age");
		textage = new JTextField(10);
		labelhigh = new JLabel("high");
		texthigh = new JTextField(10);
		Container c1 = getContentPane();
		Container c2 = getContentPane();
		Container c3 = getContentPane();
		Container c4 = getContentPane();
		Container c5 = getContentPane();
		c1.setLayout(new FlowLayout());
		c1.add(labelname);
		c1.add(textname);
		c1.add(labelpassword);
		c1.add(password1);
		c1.add(button1);
		c3.add(labelage);
		c3.add(textage);
		c4.add(labelhigh);
		c4.add(texthigh);
		c5.add(labelpicture);
		setVisible(true);
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		MyFrame my1 = new MyFrame();
		my1.show();
		my1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

}
